package homework305;

public class zuoye4 extends Thread {
	int number = 1;
	@Override
    public void run() {
        while (true) {
            synchronized (zuoyed4.lock) {
            	if(zuoyed4.count != 1){
            		 for (int i = 0; i < 2; i++) {
                         System.out.println(number);
                         number++;
                     }
                 zuoyed4.count = 1;
                 zuoyed4.lock.notify();
            	}else{
            	try {
                       
                    zuoyed4.lock.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            }
        }
    }
}
